from alchemy.utils.sql_generator import Params, BaseModelGenerator

from alchemy.meta import get_engine, get_models

def sql_create(db_alias, style):
    """
    """
    engine = get_engine(db_alias)
    models = get_models(db_alias)
    table_names = [ model.__tablename__ for model in models ]

    params = Params()
    params.dialect = engine.url.get_dialect().name
    params.user = engine.url.username
    params.password = engine.url.password
    params.host = engine.url.host
    params.db_name = engine.url.database
    params.schema = None
    params.table_list = table_names
    params.with_imports = False

    bmg = BaseModelGenerator(params)

    return bmg.get_sql_create()


    

